package edu.ubbcs.rs.backend.service.basic;

import edu.ubbcs.rs.backend.model.table.Table;
import edu.ubbcs.rs.backend.repository.RepositoryException;
import edu.ubbcs.rs.backend.repository.TableRepository;
import edu.ubbcs.rs.backend.service.ServiceException;
import edu.ubbcs.rs.backend.service.TableService;
import java.util.List;
import javax.ejb.Stateless;
import javax.inject.Inject;

/**
 * @author Merli Andras-Bertalan
 * @version 1.0
 * @created 09-jan.-2015 15:37:43
 */
@Stateless(name = "TableService")
public class BasicTableService implements TableService {

    @Inject
    private TableRepository tableRepository;

    @Override
    public List<Table> getAll() {
        try {
            return tableRepository.getAll();
        } catch (final RepositoryException ex) {
            throw new ServiceException(ex);
        }
    }

    @Override
    public Table getById(Long id) {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

    @Override
    public void insert(Table item) {
        try {
            tableRepository.insert(item);
        } catch (final RepositoryException ex) {
            throw new ServiceException(ex);
        }
    }

    @Override
    public void update(Table item) {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

    @Override
    public void delete(Table item) {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

    @Override
    public void deleteAll() {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

    @Override
    public Long getCount() {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }
}